package cn.zxhysy.booksmall.service.impl;

import cn.zxhysy.booksmall.entity.Car;
import cn.zxhysy.booksmall.entity.ProLine;
import cn.zxhysy.booksmall.mapper.ProLineMapper;
import cn.zxhysy.booksmall.service.ProLineService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class ProLineServiceImpl implements ProLineService {
    private final ProLineMapper proLineMapper;

    public ProLineServiceImpl(ProLineMapper proLineMapper) {
        this.proLineMapper = proLineMapper;
    }

    @Override
    public List<ProLine> findAll(String concreteName) {
        Example example = new Example(ProLine.class);
        Example.Criteria criteria = example.createCriteria();
        if (StringUtils.isNoneBlank(concreteName)) {
            criteria.andEqualTo("concreteName", concreteName);
        }
        return proLineMapper.selectByExample(example);
    }
}
